﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Clandestine.Battle
{
    public class Party : IEnumerable, IEnumerator
    {
        private List<Combatant> members = new List<Combatant>();
        private int curr = -1;

        public Combatant this[int index]
        {
            get { return members[index]; }
            set { members[index] = value; }
        }

        public int Count
        {
            get { return members.Count; }
        }
                
        public IEnumerator GetEnumerator()
        {
            return this;
        }

        public object Current
        {
            get { return members[curr]; }
        }

        public bool MoveNext()
        {
            curr++;
            if (curr == members.Count)
            {
                Reset();
                return false;
            }
            return true;
        }

        public void Reset()
        {
            curr = -1;
        }

        public void Add(object c)
        {
            members.Add((Combatant)c);
        }

    }
}
